const validatePattern = {
  正浮点数: /^\d+(\.\d+)?$/,
  非负整数: /^\d+$/g,
  零到一之间的数: /^(0.\d+|0|1)$/,
  零到一百之间的数: /^(100|(([1-9]){1}[0-9]?|0{1})((\.)([0-9]){1,2})?)$/
};

const validMessage = {
  必填正数: "该项必填，且必须为正数",
  必填: "该项必填",
  零到一百: "该项必须为0-100之间的数"
};

export const loginRules = {
  userName: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
  password: [{ required: true, message: "密码不能为空", trigger: "blur" }]
};

export const projectRules = {
  projectName: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
  selectedArea: [
    { required: true, message: "请选择项目所属地", trigger: "blur" }
  ],
  projectManager: [
    { required: true, message: "请选择项目负责人", trigger: "blur" }
  ],
  categories: [{ required: true, message: "请选择项目类别", trigger: "blur" }],
  chargeStandard: [
    {
      required: true,
      message: "请输入收费标准",
      trigger: "blur"
    }
  ],
  trainingMode: [
    { required: true, message: "请选择培训模式", trigger: "blur" }
  ],
  trainingTimes: [
    {
      required: true,
      message: validMessage.必填,
      trigger: "blur"
    }
  ],
  schoolManageRadio: [
    {
      required: true,
      message: "请输入学校管理费比例",
      trigger: "blur"
    }
  ],
  devFundingRadio: [
    {
      required: true,
      message: "请输入发展基金比例",
      trigger: "blur"
    }
  ],
  welfareRadio: [
    {
      required: true,
      message: "请输入福利比例",
      trigger: "blur"
    }
  ],
  classPayRadio: [
    {
      required: true,
      message: "请输入课酬比例",
      trigger: "blur"
    }
  ],
  // agency and partner
  subRule: {}
};

export const incomeStreamRules = {
  incomeAmount: [
    { required: true, message: "请输入入账金额", trigger: "blur" }
  ],
  createdDate: [{ required: true, message: "请选择入账日期", trigger: "blur" }],
  invoiceAmount: [
    { required: true, message: "请输入发票金额", trigger: "blur" }
  ]
};

export const outlayStreamRules = {
  outlayProjectCode: [
    { required: true, message: "请输入支出项目码", trigger: "blur" }
  ],
  createdDate: [{ required: true, message: "请输入支出日期", trigger: "blur" }]
};

export const userPermissionRules = {
  username: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
  password: [{ required: true, message: "密码不能为空", trigger: "blur" }],
  projectSystem: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  incomeStreamSystem: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  outlayStreamSystem: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  updateMyUser: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  queryAllProject: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  addProject: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  deleteProject: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  updateProject: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  queryAllIncomeStream: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  addIncomeStream: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  deleteIncomeStream: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  updateIncomeStream: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  queryAllOutlayStream: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  addOutlayStream: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  deleteOutlayStream: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ],
  updateOutlayStream: [
    { required: true, message: "请选择是否拥有该权限", trigger: "blur" }
  ]
};
